home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Telnet / NCSA / tn3270 2.3d26 source / tn3270 / termdef.h < prev    next >
Text File  |  1991-05-26  |  14KB  |  406 lines

  1. /*
  2.  *  tn3270 for the Macintosh Source Code
  3.  *  Brown University Computing and Information Services
  4.  *  Version 2.3d21, January 17, 1991
  5.  *  Copyright (c) 1988, 1989, 1990, 1991 by Brown University and by
  6.  *  Peter John DiCamillo.
  7.  *
  8.  *  Permission is granted to any individual or institution to use, copy,
  9.  *  or redistribute the binary version of this software and its
  10.  *  documentation provided this notice and the copyright notices are
  11.  *  retained.  Permission is granted to any individual or non-profit
  12.  *  institution to use, copy, modify, or redistribute the source files
  13.  *  of this software provided this notice and the copyright notices are
  14.  *  retained.  This software may not be distributed for profit, either
  15.  *  in original form or in derivative works, nor can the source be
  16.  *  distributed to other than an individual or a non-profit institution.
  17.  *  Any  individual or group interested in seeing and/or using these
  18.  *  source files but who are prevented from doing so by the above
  19.  *  constraints should contact Don Wolfe, Assistant Vice-President for
  20.  *  Computer Systems at Brown University, (401) 863-7250, for possible
  21.  *  software licensing of the source developed at Brown.
  22.  *
  23.  *  Brown University and Peter John DiCamillo make no representations
  24.  *  about the suitability of this software for any purpose.
  25.  *
  26.  *  BROWN UNIVERSITY AND PETER JOHN DICAMILLO GIVE NO WARRANTY, EITHER
  27.  *  EXPRESS OR IMPLIED, FOR THE PROGRAM AND/OR DOCUMENTATION PROVIDED,
  28.  *  INCLUDING, WITHOUT LIMITATION, WARRANTY OF MERCHANTABILITY AND
  29.  *  WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.
  30.  *
  31.  */
  32.  
  33. #define    NUL        0x00
  34. #define CD        0x01
  35. #define GRFBGN    0x04
  36. #define XFBGN    0x06
  37. #define    BEL    0x07
  38. #define    BS    0x08
  39. #define TAB 0x09
  40. #define    LF    0x0a
  41. #define VT    0x0b
  42. #define FF    0x0c
  43. #define    CR    0x0d
  44. #define SO    0x0e
  45. #define    DC1    0x11
  46. #define    DC3    0x13
  47. #define DC4 0x14
  48. #define CPMEOF 0x1a
  49. #define    ESC    0x1b
  50. #define    DEL    0x7f
  51.  
  52. #define NMENUS    6
  53.  
  54. #define portalrt        256        /* stoperr message codes */
  55. #define loadalrt        257
  56. #define srvalrt            258
  57. #define atpalrt            259
  58. #define rmtalrt            260
  59. #define nackalrt        261
  60. #define ioalrt            262
  61. #define    rsetalrt        263
  62. #define ssetalrt        264
  63. #define wsetalrt        265
  64. #define addralrt        266
  65. #define regalrt            267
  66. #define cfigalrt        268
  67. #define domalrt            269
  68. #define topnalrt        270
  69. #define conalrt            271
  70. #define rspalrt            272
  71. #define numalrt            273
  72. #define negalrt            274
  73. #define wrtalrt            275
  74. #define et1alrt            276
  75. #define    et2alrt            277
  76. #define    et3alrt            278
  77. #define mapalrt            279
  78. #define wpictalrt        280
  79. #define kbdefalrt        281
  80. #define kbsetalrt        282
  81. #define nlsetalrt        283
  82. #define fmtalrt            284
  83. #define hostfalrt        285
  84. #define sdsetalrt        286
  85. #define sdmemalrt        287
  86. #define newwindalrt        288
  87. #define windfmtalrt        289
  88. #define apinalrt        290
  89. #define apisalrt        291
  90. #define pnumalrt        292
  91. #define ppcinitalrt        293
  92. #define ppcnamealrt        294
  93. #define ppcopenalrt        295
  94.  
  95. #define ACK                0        /* AppleTalk Server Codes */
  96. #define    NACK            1
  97. #define POLL            2
  98. #define    DATA            3
  99. #define    WANT_BIG_DATA    4
  100. #define GOT_BIG_DATA    5
  101. #define LOGON            6
  102. #define    LOGOFF            7
  103. #define NOREMOTE        8
  104. #define NOLOCAL            9
  105.  
  106. #define NDATA        0x01        /* PCNet Server Codes */
  107. #define    NLOGOFF        0x02
  108. #define NCNTDATA    0x03
  109. #define NLOGON        0x04
  110. #define    NLOGA24        0x10
  111. #define NLOGE24        0x11
  112. #define    NLOGW24        0x91
  113.  
  114. typedef struct {                /* Format of PCNET packet data */
  115.     unsigned char type;
  116.     unsigned char data[2499];
  117.     } npacket;
  118.  
  119.                                 /* equates for CP DIAG X'7C' ldev creation */
  120. #define WSFFLAG        0x80            /* flag for Write Structured Field support */
  121. #define MDL32782    0x02            /* 3278 model 2 (24 by 80) */
  122. #define MDL32783    0x03            /* 3278 model 3 (32 by 80) */
  123. #define MDL32784    0x04            /* 3278 model 4 (43 by 80) */
  124. #define MDL32785    0x05            /* 3278 model 5 (27 by 132) */
  125. #define MDL32792    0x92            /* 3279 model 2 (24 by 80) */
  126. #define MDL32793    0x93            /* 3279 model 3 (32 by 80) */
  127. #define CLASGRAF    0x40
  128. #define TYP3278        0x01
  129.  
  130.                                 /* definitions for built-in fonts */
  131. #define SYMBOLFONT    239
  132. #define NORMALFONT    240
  133. #define APLFONT        241
  134. #define BOLDNORMAL    242
  135. #define BOLDAPL        243
  136. #define ALAFONT        244
  137. #define BOLDALA        246
  138.  
  139. typedef struct {                /* element of keyboard input queue */
  140.     unsigned char code;
  141.     unsigned char shift;
  142.     } kbdata;
  143. #define KBQMAX    160                /* size of queue */
  144.  
  145. /* typedef struct {
  146.     unsigned char * name;
  147.     unsigned char type;
  148.     unsigned char unused;
  149.     short size;
  150.     unsigned char * fvalptr;
  151.     unsigned char * cvalptr;
  152.     unsigned char * description;
  153.     } keyinfo; */
  154.  
  155. typedef struct {
  156.     unsigned char     attrmap[7];            /* attribute mappings */
  157.     char            dblevel;            /* debug level */
  158.     char             setsflg;            /* connection mode */
  159.     unsigned char    timeout;            /* seconds between retransmits */
  160.     unsigned char    retries;            /* number of retries */
  161.     char            insreset;            /* attn resets insert mode */
  162.     char            impnull;            /* improved null processing */
  163.     char            digitpfk;            /* Cmd Shift <digit> is PF */
  164.     short            mousepf;            /* double-click function */
  165.     char            basecolor;            /* base color mode */
  166.     char            exactcolor;            /* exact colors wanted */
  167.                                         /* current color settings */
  168.     RGBColor        usrwhite;
  169.     RGBColor        usryellow;
  170.     RGBColor        usrpink;
  171.     RGBColor        usrturquoise;
  172.     RGBColor        usrgreen;
  173.     RGBColor        usrred;
  174.     RGBColor        usrblue;
  175.     RGBColor        usrblack;
  176.     RGBColor        usrback;
  177.     RGBColor        usrstat;
  178.     short            dfltptsize;            /* default screen point size */
  179.     short            altptsize;            /* alternate screen point size */
  180.     short            altrows;            /* rows for alternate screen */
  181.     short            altcols;            /* columns for alternate screen */
  182.     short            custrows;            /* custom row size */
  183.     short             custcols;            /* custom column count */
  184.     short            windpth;            /* window center point- horiz. pos. */
  185.     short            windptv;            /* window center point- vert. pos. */
  186.     char            invertbw;            /* swap black and white */
  187.     char            stat_time;            /* status line time display */
  188.     char            curpos;                /* display cursor position */
  189.     char            blockcurs;            /* block cursor */
  190.     char            ext3270;            /* extended data stream support */
  191.     char             std_brack;            /* treat [ and ] normally */
  192.     char            windmax;            /* always use maximum window size */
  193.     char             repnull;            /* change embedded blanks to nulls */
  194.     char            savewpos;            /* save window position in file */
  195.     char            autoconn;            /* connect to host when settings loaded */
  196.     OSType            text_creator;        /* creator for text files */
  197.     char            simps;                /* simulate programmed symbol support */
  198.     char            unused;                /* for even length */
  199.                                 /* even length should be maintained */ 
  200.     } settings_list;
  201.  
  202. #define DFLTWHITE    {0xffff, 0xffff, 0xffff}
  203. #define DFLTYELLOW    {0xfc00, 0xf37d, 0x052f}
  204. #define DFLTRED        {0xdd6b, 0x08c2, 0x06a2}
  205. #define CTDFLTPINK    {0xf2d7, 0x0856, 0x84ec} /* in 16-color ctab */
  206. #define DFLTPINK    {0xffff, 0x7a5d, 0x9f8e}
  207. #define CTDFLTBLUE    {0x0000, 0x0000, 0xd400} /* in 16-color ctab */
  208. #define DFLTBLUE    {0x4eba, 0x6aea, 0xdd6b}
  209. #define CTDFLTTURQUOISE  {0x0241, 0xab54, 0xeaff} /* in 16-color ctab */
  210. #define DFLTTURQUOISE  {0x0000, 0xc42f, 0xeaff}
  211. #define DFLTGREEN    {0x1f21, 0xb793, 0x1431}
  212. #define    DFLTBLACK    {0x0000, 0x0000, 0x0000}
  213. #define DFLTBACK    {0x2a00, 0x2a00, 0x2a00}
  214. #define CTDFLTBACK    {0x4000, 0x4000, 0x4000}    /* in 16-color ctab */
  215.  
  216.                         /* palette indices for colors */
  217. #define RGBblack        1
  218. #define RGBwhite        2
  219. #define RGBback            3
  220. #define RGBgreen        4
  221. #define RGBred            5
  222. #define    RGBblue            6
  223. #define RGBpink            7
  224. #define RGByellow        8
  225. #define RGBturquoise    9
  226. #define RGBstat            10
  227.  
  228. /* point positions for selected text
  229.  
  230.          3---------------------4
  231.          |                     |
  232.   1------2                     |
  233.   |                            |
  234.   |                            |
  235.   |              6-------------5
  236.   |              |
  237.   8--------------7
  238.                                     */
  239.  
  240. typedef struct {        /* coordinates defining selected text */
  241.     short x1;
  242.     short y1;
  243.     short x2;
  244.     short y2;
  245.     short x3;
  246.     short y3;
  247.     short x4;
  248.     short y4;
  249.     short x5;
  250.     short y5;
  251.     short x6;
  252.     short y6;
  253.     short x7;
  254.     short y7;
  255.     short x8;
  256.     short y8;
  257.     } selcoord;
  258.     
  259. typedef struct scrapline {        /* definition of private scrap line element */
  260.     struct scrapline *nextline;
  261.     unsigned char *text;
  262.     unsigned short *attr;
  263.     } scrapline;
  264.     
  265. typedef struct hexmap {
  266.     unsigned short offset;
  267.     unsigned char stdchar;
  268.     unsigned char aplchar;
  269.     } hexmap;
  270.     
  271. typedef struct vmprt {                /* values to control WMAC PRINT output */
  272.                             /* default:     definition:                    */
  273.     unsigned short fontnum;        /* 22        font number */
  274.                                 /*            monaco = 4; courier = 22 */
  275.     unsigned short pointsize;    /* 11        font point size */
  276.     unsigned short leading;        /* 12        line spacing, inches*72 */
  277.     unsigned short linewidth;    /* 132        maximum characters per line; */
  278.                                 /*            *cannot exceed 132* */
  279.     unsigned short tabsize;        /* 4        tab spacing */
  280.     unsigned short pagelength;    /* 57        maximum lines/page (no cc) */
  281.     unsigned short pagelencc;    /* 59        maximum lines/page (with cc) */
  282.     unsigned short top;            /* 14        top margin, inches*72 */
  283.     unsigned short headmarg;    /* 2        lines between header & text (no cc) */
  284.     unsigned short left;        /* 12        left margin, inches*72 (no cc) */
  285.     unsigned short leftcc;        /* 0        left margin, inches*72 (with cc) */
  286.     unsigned short titlewidth;    /* 74        width of title line in characters */
  287.                                 /*            *cannot exceed 132* */
  288.     unsigned short unused1;        /* 0        space for future additions */
  289.     unsigned short unused2;        /* 0                                   */
  290.     unsigned short unused3;        /* 0                                   */
  291.     unsigned short unused4;        /* 0                                   */
  292.     } vmprt;            /* this structure is stored in the VMPR 128 resource */
  293.  
  294. #define MAXLINEWIDTH 132        /* maximum allowed for line width */
  295.  
  296. typedef struct uareply {        /* Usable Area Query Reply */
  297.     unsigned short length;            /* structured field total length  (46) */
  298.     unsigned char sfid;                /* structured field id (X'81') */
  299.     unsigned char qcode;            /* usable area id (X'81') */
  300.     unsigned char flags1;            /* first flag byte  (X'03') */
  301.     unsigned char flags2;            /* second flag byte  (X'00') */
  302.     unsigned short w;                /* width of usable area  (computed) */
  303.     unsigned short h;                /* height of usable area (computed) */
  304.     unsigned char units;            /* units of measure (X'00' = inches) */
  305.     unsigned char xr[4];            /* x point spacing (X'00010048' = 1/72) */
  306.     unsigned char yr[4];            /* y point spacing (X'00010048' = 1/72) */
  307.     unsigned char aw;                /* width of default cell  (computed) */
  308.     unsigned char ah;                /* height of default cell (computed) */
  309.     unsigned char buffsz[2];        /* character buffer size (X'0000') */
  310.     unsigned char xmin;                /* minimum x units in cell (X'00') */
  311.     unsigned char ymin;                /* minimum y units in cell (X'00') */
  312.     unsigned char xmax;                /* maximum x units in cell (X'00') */
  313.     unsigned char ymax;                /* maximum y units in cell (X'00') */
  314.     unsigned char aualen;            /* length for alternate usable area (X'13') */
  315.     unsigned char auapid;            /* parameter id for alt. usable area (X'02') */
  316.     unsigned char auares;            /* reserved (X'00') */
  317.     unsigned char auaid;            /* id for alt. usable area partition (X'01') */
  318.     unsigned char waua[2];            /* width of alt. usable area (computed) */
  319.     unsigned char haua[2];            /* height of alt. usable area (computed) */
  320.     unsigned char auaunits;            /* units of measure (X'00' = inches) */
  321.     unsigned char auaxr[4];            /* x point spacing (X'00010048' = 1/72) */
  322.     unsigned char auayr[4];            /* y point spacing (X'00010048' = 1/72) */
  323.     unsigned char awaua;            /* width of default cell  (computed) */
  324.     unsigned char ahaua;            /* height of default cell (computed) */
  325.     } uareply;
  326.     
  327. typedef struct ipreply {        /* Implicit Partition Query Reply */
  328.     unsigned short length;            /* structured field total length  (28) */
  329.     unsigned char sfid;                /* structured field id (X'81') */
  330.     unsigned char qcode;            /* implicit partition id (X'A6') */
  331.     unsigned char flags[2];            /* flags - reserved (X'0000') */
  332.     unsigned char scrnlen;            /* length of screen parameters (X'0B') */
  333.     unsigned char scrnpid;            /* screen parameter id (X'01') */
  334.     unsigned char scrnflags;        /* screen flags - reserved (X'00') */
  335.     unsigned char wd[2];            /* default width in chars (computed) */
  336.     unsigned char hd[2];            /* default height in chars (computed) */
  337.     unsigned char wa[2];            /* alternate width in chars (computed) */
  338.     unsigned char ha[2];            /* alternate height in chars (computed) */
  339.     unsigned char celllen;            /* length of cell sizes (X'0B') */
  340.     unsigned char cellpid;            /* cell size parameter id (X'02') */
  341.     unsigned char cellflags;        /* cell size flags - reserved (X'00') */
  342.     unsigned char wcd[2];            /* default cell width (computed) */
  343.     unsigned char hcd[2];            /* default cell height (computed) */
  344.     unsigned char wca[2];            /* alternate cell width (computed) */
  345.     unsigned char hca[2];            /* alternate cell height (computed) */
  346.     } ipreply;
  347.     
  348. #define NMRNUM    2                    /* number of notification manager messages */
  349.  
  350. typedef struct {                    /* Notification Manager record and message */
  351.     NMRec qelem;
  352.     unsigned char msg[256];
  353.     } nmrmessage;
  354.  
  355. typedef struct {
  356.     unsigned char *next;            /* actually qctl* */
  357.     char inuse;
  358.     char pend_inuse;
  359.     } qctl;
  360.  
  361. typedef struct {                    /* PPC queue descriptor */
  362.     unsigned char name[8];    /* name of queue (for messages) */
  363.     qctl *first;            /* pointer to first element */
  364.     Size elemsize;            /* size of one queue element */
  365.     short minavail;            /* allocate to keep this many available */
  366.     char stgerr;            /* allocation failed */
  367.     char spare;
  368.     } queueinfo;
  369.  
  370. typedef struct {
  371.     long sessrefnum;
  372.     long userdata;
  373.     char servicetype;
  374.     char reqtype;
  375.     char mykind;            /* 0 for session manager, or session number */
  376.     char spare;
  377.     } clientinfo;
  378.     
  379. typedef struct {
  380.     long length;
  381.     long userdata;
  382.     long creator;
  383.     long type;
  384.     long sessrefnum;
  385.     char more;
  386.     char incoming;            /* true if data from PPCRead */
  387.     char mykind;            /* 0 for session manager, or session number */
  388.     char spare;
  389.     unsigned char msg[128];
  390.     } datainfo;
  391.     
  392. typedef struct {
  393.     qctl header;
  394.     PPCParamBlockRec pb;
  395.     } paramrec;
  396.  
  397. typedef struct {
  398.     qctl header;
  399.     clientinfo client;
  400.     } clientrec;
  401.  
  402. typedef struct {    
  403.     qctl header;
  404.     datainfo data;
  405.     } datarec;
  406.